<template>
  <a-row type="flex" style="flex-flow: inherit;">
    <a-col :flex="toggle?'260px':'30px'" style="margin-right: 12px;background-color: #fff;">
      <div style="background-color: #FFFFFF;width: 100%;padding: 15px">
        <a-steps direction="vertical" size="small" :current="current" @change="onChange">
          <a-step title="通知送戒单位" />
          <a-step title="送戒单位上传材料"/>
          <a-step title="人员出所通知" />
          <a-step title="通知专职（社工）人员" />
          <a-step title="人员接收" />
        </a-steps>
      </div>
    </a-col>
    <a-col flex="auto">
      <a-card>
        <pulldown header="通知送戒单位" v-if="current>=0">
          <div slot="content">
            <notice @currentFu="currentFu" :current="current"></notice>
          </div>
        </pulldown>
        <pulldown header="送戒单位上传材料" v-if="current >= 1">
          <div slot="content">
            <uploadTheFile @currentFu="currentFu" :current="current"></uploadTheFile>
          </div>
        </pulldown>
        <pulldown header="人员出所通知" v-if="current >= 2">
          <div slot="content">
            <leave @currentFu="currentFu" :current="current" ></leave>
          </div>
        </pulldown>
        <pulldown header="通知专职（社工）人员" v-if="current >= 3">
          <div slot="content">
            <administrator @currentFu="currentFu" :current="current"></administrator>
          </div>
        </pulldown>
        <pulldown header="人员接收" v-if="current >= 4">
          <div slot="content">
            <reception @currentFu="currentFu" :current="current"></reception>
          </div>
        </pulldown>
      </a-card>
    </a-col>

  </a-row>
</template>

<script>
import notice from "@views/sjsk/management/join/supervise/cohesionmode/notice";
import leave from "@views/sjsk/management/join/supervise/cohesionmode/leave";
import administrator from "@views/sjsk/management/join/supervise/cohesionmode/administrator";
import reception from "@views/sjsk/management/join/supervise/cohesionmode/reception";
import uploadTheFile from "@views/sjsk/management/join/supervise/cohesionmode/uploadTheFile";
import pulldown from '../../../modules/pulldown'
import {USER_INFO} from "@/store/mutation-types";
import Vue from "vue";
export default {
  name: "cohesion",
  components:{pulldown,notice,leave,administrator,reception,uploadTheFile},
  data(){
    return {
      toggle:true,
      current:0,
      leaveData:{}
    }
  },
  created() {
    this.current = Number(this.$route.query.currentStage)
    this.$store.dispatch('categoryListFun',this.current)
  },
  mounted() {
    console.log(Vue.ls.get(USER_INFO))
  },
  methods:{
    onChange(current){
      if(current <= Number(this.$route.query.currentStage)){
        this.current = current;
      } else {
        this.$message.info('您还没有到该步流程')
      }
    },
    currentFu(val){
      this.current = val
    },
    leaveDataFun(val){
      console.log(val)
      this.leaveData = val
    }
  }
}
/*
/supervise/suoerviseJmodal
 */
</script>

<style scoped>

</style>